﻿@using PESWebMVC.Resources
@model PESWebMVC.Models.LoginModel

@{
    ViewBag.Title = "Log in";
}

@Html.Action("ExternalLoginsList", new { ReturnUrl = ViewBag.ReturnUrl })

<hr />

<p>@RscLabels.InternalLoginLabel</p>

@using (Html.BeginForm("Login", "Account",
                       new {ReturnUrl = ViewBag.ReturnUrl},
                       FormMethod.Post, new { @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <div class="control-group">
        @Html.LabelFor(m => m.UserName, new {@class = "control-label"})
        <div class="controls">
            @Html.TextBoxFor(m => m.UserName) &nbsp;
            @Html.ValidationMessageFor(m => m.UserName, "", new {@class = "alert-error"})
        </div>
    </div>

    <div class="control-group">
        @Html.LabelFor(m => m.Password, new {@class = "control-label"})
        <div class="controls">
            @Html.PasswordFor(m => m.Password) &nbsp;
            @Html.ValidationMessageFor(m => m.Password, "", new {@class = "alert-error"})
        </div>
    </div>

    <div class="control-group">
        <div class="controls">
            <label class="checkbox">                
                @RscLabels.RememberMe
                @Html.CheckBoxFor(m => m.RememberMe)
            </label>
            <button class="btn btn-large btn-primary" type="submit">@RscButtonsText.LoginButton</button>
        </div>
    </div>
    <p>
        @Html.ActionLink(RscLabels.Register, "Register") @RscLabels.RegisterPartialLabel
    </p>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
